const co = require('co')
const requestPro = require('request-promise-native')
const jsdom = require("jsdom");
const request = require('request')
const {
	JSDOM
} = jsdom;

// let url = 'http://v.qq.com/x/list/music?istate=1&offset=0&sort=5&iarea=791'

// function getHTML() {
// 	return co(function*() {
// 		return yield request(url)
// 	})
// }

// getHTML().then(html => {
// 	const {
// 		document
// 	} = (new JSDOM(html)).window;
// 	console.log(document.getElementsByClassName('filter_content')[0])
// 	console.log(document.getElementsByClassName('filter_content')[0].innerHTML)
// 	// console.log(html)
// })

let options = {
	"baseUrl": "http://192.168.1.3:8082/ReportWS",
	"url": "/SP/info/report/getcp.do",
	"method": "GET",
	"headers": {
		"AccessToken": "YjM5YjM3MzY0NjJiOTkzZDU3ODgxMTNmZjcxYmVhYzI=5a042c13",
		"Cookie": "JSESSIONID=D9842735895180691FC83F93CD96119C; OUTFOX_SEARCH_USER_ID_NCOO=1920672670.5657625; OFBiz.Visitor=177995; CNZZDATA1256824629=844884980-1461038064-%7C1502854288; connect.sid=s%3ArwcMYGY6ZH339GbAACz5ehn3hvXBgYvm.vKESG0NClptzmtur%2B4ykKJc8bKiwAMf%2BEehXXe9BtGg; ___rl__test__cookies=1510209127591"
	},
	"qs": {
		"spid": "all",
		"start": "0",
		"limit": "100",
		"cpid": "",
		"cpname": ""
	}
}
request(options, function(err, res, body) {
	console.log('body', body)
})

// requestPro(options).then(result => {
// 	console.log('result', result)

// })